<template>
  <readonly-form :fields="dataFields" :data="data"/>
</template>

<script>
import { reactive } from 'vue'
import { handleFormEmptyData } from '@/tools/filters'

export default {
  props: {
    data: {
      type: Object,
      default: () => ({})
    }
  },
  setup() {
    const dataFields = reactive([
      {
        title: '基础信息',
        fields: [
          { span: 6, title: '学校中文名', field: 'schoolCnName' },
          { span: 6, title: '学校英文名', field: 'schoolEnName' },
          { span: 6, title: '大学缩写', field: 'schUniversityAbbreviation' },
          { span: 6, title: '性质', field: 'schNature' },
          { span: 6, title: '类别', field: 'schCategory' },
          { span: 6, title: '官方地址', field: 'schOfficialWebsiteAddress' },
          { span: 6, title: '学制', field: 'schSchoolSystem' },
          { span: 6, title: '所属国家', field: 'schCountry' },
          { span: 6, title: '省/州', field: 'schProvince' },
          { span: 6, title: '城市', field: 'schCity' },
          { span: 6, title: '街道', field: 'schStreet' },
          { span: 6, title: '邮编', field: 'schMailbox' },
          { span: 6, title: '学生人数', field: 'schStuNumber' },
          { span: 6, title: '国际学生人数', field: 'schInternationalStuNumber' },
          { span: 6, title: '排名', field: 'schRanking' },
          { span: 6, title: '意向项目', field: 'schIntendedProject' },
          { span: 6, title: '是否有网课', field: 'schOnlineYesno' },
          { span: 6, title: '学费', field: 'schTuition' },
          { span: 6, title: '开始合作时间', field: 'schStartCooperationTime' },
          { span: 6, title: '成立时间', field: 'schEstablishmentTime' },
          { span: 24, title: '是否与竞争对手合作', field: 'schCompetitorYesno' },
          { span: 24, title: '学费情况', field: 'schTuitionFees', labelCol: { span: 6 } },
          { span: 24, title: '国内合作高校', field: 'schDomesticCooperativeUniversities' },
          { span: 24, title: '开设专业', field: 'schOpenMajor' },
          { span: 24, title: '结算条件', field: 'schExpenseSettlementConditions' },
          { span: 24, title: 'course catalog', field: 'schCourseCatalog' },
          { span: 24, title: 'database link', field: 'schDatabaseLink' },
          { span: 24, title: '市场情况', field: 'schMarketDetails' },
        ],
      },
      {
        title: '转学分信息',
        fields: [
          { span: 24, title: '转学分政策', field: 'schCreditTransferPolicy' },
          { span: 24, title: '转学分要求', field: 'schCreditTransferRequirements' },
          { span: 24, title: '成绩要求', field: 'schPerformanceRequirements' },
          { span: 24, title: 'GPA要求', field: 'schGpaRequirements' },
          { span: 24, title: '学分限制', field: 'schCreditLimit' },
          { span: 24, title: '备注说明', field: 'schRemarks' },
        ]
      },
      {
        title: '寄送信息',
        fields: 'schoolSendList',
        type: 'array',
        childFields: [
          { span: 4, title: '收件人', field: 'schAddressee' },
          { span: 5, title: '联系电话', field: 'schPhone' },
          { span: 5, title: '邮编', field: 'schMailbox' },
          { span: 10, title: '地址', field: 'schSendProvince' }
        ]
      },
      {
        title: '邮箱后缀',
        fields: [
          { span: 24, title: '邮箱后缀', field: 'schMailboxSuffix' },
        ]
      },
      {
        title: '历年calendar',
        fields: 'schCalendarYearList',
        type: 'array',
        childFields: [
          { span: 4, title: '学期', field: 'schCySemester' },
          { span: 5, title: '开课时间', field: 'schCyBegindate' },
          { span: 5, title: '考试时间', field: 'schCyExaminationdate' },
          { span: 10, title: '放假时间', field: 'schHolidaydate' }
        ]
      },
      {
        title: '附件信息',
        fields: [
          { span: 24, title: 'Logo', field: 'logo' },
          { span: 24, title: '合同', field: 'contract' },
          { span: 24, title: '其他附件', field: 'other' },
          { span: 24, title: '课程大纲页尾', field: 'courseHeader' },
          { span: 24, title: '课程大纲页脚', field: 'courseFooter' },
        ]
      },
    ])

    return {
      dataFields,
      handleFormEmptyData,
    }
  }
}
</script>
